POV-Ray : Newsgroups : povray.general : Fractals with functions : Re: Fractals with functions Server Time
5 Aug 2024 10:25:44 EDT (-0400)
  Re: Fractals with functions  
From: Warp
Date: 1 Oct 2002 11:18:01
Message: <3d99bca9@news.povray.org>
Pyry <fro### [at] suomi24fi> wrote:
> Is there a way to create a fractal(mandelprot) pattern with the function
> pattern or a 4D-julia with the isosurface?

  You can create the mandelbrot and julia sets using the patterns with
the same names.
  However, you can't create recursive fractal functions (because functions
don't allow recursion).

  I can say that recursion support was tested before the final 3.5 was
released, and I even successfully made a mandelbrot function with it, but
due to several problems which arose, it was decided to not to include
support for that.

  By the way, the mandelbrot function looked like this:

#declare MaxIter = 30;

#declare MandIter =
  function(Re, Im, Zr, Zi, n)
  {
    select(n<MaxIter & Zr*Zr+Zi*Zi<4, 0, n,
      MandIter(Re, Im, Zr*Zr-Zi*Zi+Re, 2*Zr*Zi+Im, n+1))
  }

#declare Mandel = function { MandIter(x, y, x, y, 0)/MaxIter }

  Usage example:

box
{ <-2,-1.5,0>, <1,1.5,.1>
  pigment
  { function { Mandel(x,y,z) }
    color_map { [0 rgb z*.5][1 rgb <.5,.75,1>][1 rgb 0] }
  }
  finish { ambient 1 }
}


  Naturally it was slower than using the internal mandlebrot pattern,
but in no way unacceptably slow.

  It's a real pitty that it was dropped... :(

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.